{extend name="index_layout"/}
{block name="main"}
<form class="layui-form" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input id="c-name" lay-verify="required" class=" layui-input" name="row[name]" type="text"
                   value="{$data.name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">图片</label>
        <div class="layui-input-block">
            <div class="layui-col-xs4">
                <input id="c-image" lay-verify="required" class=" layui-input" size="50" name="row[image]" type="text"
                       value="{$data.image}">
            </div>
            <button type="button" id="faupload-image" class="layui-btn faupload" data-input-id="c-image"
                    data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false"
                    data-preview-id="p-image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" id="fachoose-image" class="layui-btn fachoose" data-input-id="c-image"
                    data-mimetype="image/*" data-multiple="false"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input id="row[status_switch]-0" name="row[status_switch]" type="radio" value="1" title="ON" {eq
                   name="data.status_switch" value="1" }checked{/eq} />
            <input id="row[status_switch]-1" name="row[status_switch]" type="radio" value="0" title="OFF" {eq
                   name="data.status_switch" value="0" }checked{/eq} />
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input id="c-sort" lay-verify="required" class=" layui-input" name="row[sort]" type="number"
                   value="{$data.sort}">
        </div>
    </div>
    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use('yznForm', function () {
        var yznForm = layui.yznForm;
        yznForm.bindevent($("form.layui-form"));
    });
</script>
{/block}